$package('YiYa.merchant');
YiYa.merchant = function(){
	var _box = null;
	var _this = {
		config:{
			dataGrid:{
				title:'产品列表',
				url:'dataList.do?type=1',
				columns:[[
				          {field:'id',checkbox:true},
				          {field:'code',title:'编号',width:120},
				          {field:'name',title:'名称',width:120},
				          {field:'color',title:'颜色',width:80},
				          {field:'standard',title:'规格',width:80,sortable:true,},
				          {field:'p.create_time',title:'创建时间',width:120,sortable:true,
				        	  formatter:function(value,row,index){
				        		  return row["createTime"];
						  }},
				          {field:'p.update_time',title:'更新时间',width:120,sortable:true,
				        	  formatter:function(value,row,index){
				        		  return row["updateTime"];
						  }},
						  {field:'remark',title:'备注',width:120,
							  formatter:function(value,row,index){
								  if(value!=undefined){
									  if(value.length>10){
										  var str = value.substring(0,8);
										  return str.concat('......');	  
									  }
									  return value;
								  }
								  
						  }}
				          ]],
				          toolbar:[
				                   {id:'btnadd',text:'添加',btnType:'add'},
				                   {id:'btnedit',text:'编辑',btnType:'edit'},
				                   {id:'btndelete',text:'删除',btnType:'remove'},
				                   {id:'btnview',text:'查看',btnType:'view'}
				                   ]
			}
		},
		init:function(){
			_box = new YDataGrid(_this.config);
			_box.init();
		}
	}
	return _this;
}();

$(function(){
	YiYa.merchant.init();
});


